package com.bw.wxy.handler;

import android.os.Handler;
import android.os.Message;

import androidx.annotation.NonNull;

import java.lang.ref.WeakReference;

public class TimeHandler extends Handler {

    private WeakReference<TimerCallBack>weakReference;

    public TimeHandler(TimerCallBack callBack){
        weakReference = new WeakReference<>(callBack);
    }

    @Override
    public void handleMessage(@NonNull Message msg) {
        super.handleMessage(msg);
        weakReference.get().callBack();
    }

    public interface TimerCallBack{
        void callBack();
    }
}

